#ifndef TYPE_H_
#define TYPE_H_

// define type for ID
#define int64	long long int 
#define uint64	unsigned int64

// define useful constance
#define PROGRESS		100000	// used for displaying progress
#define IDLEN			16		// length of ID(QueryID & SessionID) 
#define CLICKLINESIZE	2048	// largest size of one line in click file
#define QUERYLINESIZE	1024	// largest size of one line in query file
#define MOSTCLICKS		600		// the maximum number of one query's clicks

// define suffix string for each type of file
#define STAT	".stat"			// used for statistics file
#define LOC		".loc"			// used for ASCII location file
#define LOCBIN	".loc-bin"		// used for binary location file
#define QS		".qs"			// used for query's score file
#define QSBIN	".qs-bin"		// used for binary query's score file

// used to write and read location file
struct ClickLocation
{
	//char ID[IDLEN + 1];
	uint64 ID;
	int location;
	int count;
};

#define LOCSIZE	sizeof(ClickLocation)

// used to read all location iterms into memory
struct ClkLocList
{
	int size;
	ClickLocation *arr;
};

// used to read and write query's score file
struct QueryScore
{
	uint64 ID;
	double score;
};

#define QSSIZE	sizeof(QueryScore)


/*
 * Description of files
 * file type		filename			file format
 * ======================================================================================
 * query file		*.queries.txt		Time	Query	QueryID	SessionID	ResultCount
 * click file		*.clicks.txt		QueryID	Query	Time	URL	Position
 * stat file		*.clicks.stat.txt	no
 * location file	*.clicks.loc.txt	QueryID	Location	Count
 * 					*.clicks.loc-bin.txt
 * precision file	*.queries.prcsn.txt	QueryID	Precision
 * --------------------------------------------------------------------------------------
 * (NOTE: suffixes in filename are consistent with the ones defined above!) 
 */

#endif /*QUERYINFO_H_*/
